package com.csun.cmny.provider.dto;

import com.csun.cmny.base.dto.BaseQuery;
import com.csun.cmny.provider.validator.ExamineValid;

import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

@Data
public class ExamineDto extends BaseQuery {
    @NotNull(message = "{id.empty}", groups = {ExamineValid.class})
    private Long id;

    @NotNull(message = "{id.empty}", groups = {ExamineValid.class})
    private Integer oldmanid;

    private String oldManName;

    private Integer groupId;//组织ID

    @NotEmpty(message = "{Examine.yasuo.notnull}", groups = {ExamineValid.class})
    @Size(min = 1, max = 20, message = "{Examine.length.range}", groups = {ExamineValid.class})
    private String SBP;

    @NotEmpty(message = "{Examine.szy.notnull}", groups = {ExamineValid.class})
    @Size(min = 1, max = 20, message = "{Examine.szy..length.range}", groups = {ExamineValid.class})
    private String DBP;

    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{Advisory.date.pattem.error}",
            groups={ExamineValid.class})
    private String examinetime;

    @Pattern(regexp="^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])"
            + "|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|"
            + "[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$",
            message="{Advisory.date.pattem.error}",
            groups={ExamineValid.class})
    private String registerdate;

    @NotEmpty(message = "{Examine.oldman.name.notnull}", groups = {ExamineValid.class})
    @Size(min = 1, max = 128, message = "{Examine.dengjiren.name.length}", groups = {ExamineValid.class})
    private String registerpeople;

    @NotEmpty(message = "{Examine.hospitol.notnull}", groups = {ExamineValid.class})
    @Size(min = 1, max = 128, message = "{Examine.hospitol.length.range}", groups = {ExamineValid.class})
    private String examinehospital;

    @NotEmpty(message = "{Examine.tijian.result.notnull}", groups = {ExamineValid.class})
    @Size(min = 1, max = 128, message = "{Examine.tijian.length.range}", groups = {ExamineValid.class})
    private String examineresult;

    @NotEmpty(message = "{Examine.jietu.url.notnull}", groups = {ExamineValid.class})
    @Size(min = 1, max = 1024, message = "{Examine.jietu.url.range}", groups = {ExamineValid.class})
    private String examinephoto;

    @NotEmpty(message = "{Examine.tijian.info.notnull]", groups = {ExamineValid.class})
    @Size(min = 1, max = 10, message = "{Examine.tijian.info.length.range}", groups = {ExamineValid.class})
    private String examineinfo;

    @NotEmpty(message = "{Examine.gmxs.notnull}", groups = {ExamineValid.class})
    @Size(min = 1, max = 512, message = "{Examine.gmxs.length.range}", groups = {ExamineValid.class})
    private String dhistory;

    @NotEmpty(message = "{Examine.jwbs.notnull}", groups = {ExamineValid.class})
    @Size(min = 1, max = 128, message = "{Examine.jwbs.length.range}", groups = {ExamineValid.class})
    private String pshistory;

    @NotEmpty(message = "{Examine.tizhong.notnull}", groups = {ExamineValid.class})
    @Size(min = 1, max = 20, message = "{Examine.tizhong.length.notnull}", groups = {ExamineValid.class})
    private String weight;

    @NotEmpty(message = "{Examine.shengao.notnull}", groups = {ExamineValid.class})
    @Size(min = 1, max = 20, message = "{Examine.shengao.length.range}", groups = {ExamineValid.class})
    private String height;

    @NotNull(message = "{Examine.shifou.canji.notnull}", groups = { ExamineValid.class })
    @Range(min = 0, max = 1, message = "{Examine.shifou.canji.range.error}", groups = { ExamineValid.class })
    private Integer isdisabled;

    @NotNull(message="{Examine.shifou.code.notnull}",groups={ExamineValid.class})
    @Pattern(regexp = "^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$|^[1-9]\\d{5}[1-9]\\d{3}"
            + "((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X)[1-7][1-4]$",message = "残疾证编号格式不正确", groups = { ExamineValid.class })
    private String disabledno;

    @NotNull(message="{Examine.jingshencanjki.notnull}",groups={ExamineValid.class})
    @Range(min=1,max=4,message="{Examine.canji.level.range.error}",groups={ExamineValid.class})
    private Integer sdisabledlevel;

    @NotNull(message="{Examine.zhiti.level.notnull]",groups={ExamineValid.class})
    @Range(min=1,max=4,message="{Examine.zhiti.level.range.error}",groups={ExamineValid.class})
    private Integer bdisabledlevel;

    private Integer valid;

    private Date createtime;

    private Date modifytime;

    private Long modifier;

    private Long userId;

    private  String userName;

    private int version;

    private String remark;


    private static final long serialVersionUID = 1L;


}